﻿using Koala.Pro.ViewModels;
using System.Windows;
using System.Windows.Input;

namespace Koala.Pro.Views
{
    public partial class LoginView : Window
    {
        public LoginViewModel ViewModel { get; }
        public LoginView(LoginViewModel viewModel)
        {
            ViewModel = viewModel;
            InitializeComponent();
            this.DataContext = this;
            ViewModel.LoginCompletionHandler = () => { base.DialogResult = true; };
        }

        private void Window_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.LeftButton == MouseButtonState.Pressed)
            {
                DragMove();
            }
        }

        private void btnMinimize_Click(object sender, RoutedEventArgs e)
        {
            base.WindowState = WindowState.Minimized;
        }

        private void btnClose_Click(object sender, RoutedEventArgs e)
        {
            Application.Current.Shutdown();
        }
    }
}
